<!--
 * @Description: 网页换肤
 * @Author: Sun
 * @Date: 2019-07-01 20:05:50
 * @LastEditors: Sun
 * @LastEditTime: 2019-07-01 21:56:47
 -->
<!DOCTYPE html>
<html lang="en" id="km">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>网页换肤className</title>
</head>

<body>
  <input type="button" value="皮肤1" onclick="km1()">
  <input type="button" value="皮肤2" onclick="out2()">
  <style>
    .d1 {
      background: #000;
      color: #fff;
    }

    .d2 {
      background: yellow;
      color: #000;
    }
  </style>
  <script>
    function km1() {
      let dv = document.getElementById("km")
      dv.className = "d1"

    }

    function out2() {
      let dv = document.getElementById("km")
      dv.className = "d2"

    }
  </script>

</body>

</html>